package com.example.demo.service;

import com.example.demo.domain.Hotel;
import com.example.demo.domain.HotelExample;
import com.example.demo.domain.RoomType;
import com.example.demo.mapper.HotelMapper;
import com.example.demo.service.dao.HotelDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class HotelServiceImpl implements HotelService {
    HotelDao dao=new HotelDao();

    @Autowired
    private HotelMapper hotelMapper;

    @Override
    public List<Hotel> allHotel() {
        return hotelMapper.selectByExample(new HotelExample());
    }


    @Override
    public List<Hotel> findHotel(String dest,String key) {
        return dao.findhotel(dest,key);
    }

    @Override
    public List<Hotel> findHoteldetail(String dest, String key, int star, int breakfast, double score, double lowprice, double highprice) {
        return dao.findhoteldetail(dest,key,star,breakfast,score,lowprice,highprice);
    }

    @Override
    public Hotel findhotelbyid(long id) {
        return dao.findhotelbyid(id);
    }

    @Override
    public ArrayList<RoomType> findtypebyid(String id) {
        return dao.findtypebyid(id);
    }


}